home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-04 | 42.5 KB | 1,115 lines |
- C.S.M.P. Digest Sun, 03 May 92 Volume 1 : Issue 70
-
- Today's Topics:
-
- Can I get a handle to a TE in a dialog box?
- Two Neophyte Questions (dialog box, screen depth)
- PostScript Tool Needed
- animation: novice needs help
- Anyone want to write/has written a 'sun-mouse' init ?;-}
- filename from pathnumber
- Floppy Disk Override Part II
-
-
- The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
-
- These digests are available (by using FTP, account anonymous, your email
- address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
- edu. This is also the home of the comp.sys.mac.programmer Frequently Asked
- Questions list. The last several issues of the digest are available from
- sumex-aim.stanford.edu as well.
-
- These digests are also available via email. Just send a note saying that you
- want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
- automatically receive each new digest as it is created.
-
- The articles in these digests are taken directly from comp.sys.mac.programmer.
- They are not edited; all articles included in this digest are in their original
- posted form. The only articles that are -not- included in these digests are
- those which didn't receive any replies (except those that give information
- rather than ask a question). All replies to each article are concatenated
- onto the original article in the order in which they were received. Article
- threads are not added to the digests until the last article added to the
- thread is at least one month old (this is to ensure that the thread is dead
- before adding it to the digests).
-
- Send administrative mail to mkelly@cs.uoregon.edu.
-
- -------------------------------------------------------
-
- From: dave@PRC.Unisys.COM (David Lee Matuszek)
- Subject: Can I get a handle to a TE in a dialog box?
- Date: 19 Mar 92 19:38:48 GMT
- Organization: Paoli Research Center - Paoli, PA
-
- I have a dialog box with something like this in it:
-
- When should the program quit?
- o after _____ minutes
- o when _____ responses have been given
-
- The "o" denotes a radio button, the "_____" denotes a TextEdit area
- overlaid on the radio button text. (The example is simplified;
- actually there are half a dozen radio buttons, etc.)
-
- Tabbing through the TEs works just fine. And just as I want, whenever
- I tab to the next one, the whole range of text is selected/highlighted
- in it.
-
- Clicking on a TE also works fine. I can get the corresponding radio
- button set.
-
- BUT if I click on a radio button, I want to be able to select the
- correct TE, and select/highlight the range of text in it. I can't do
- this.
-
- My fuzzy understanding is that there's really only one TE record for
- the whole dialog, and the OS reuses it as you move from TE area to TE
- area. (Corrections welcome.) OK, I can live with that; but how do I
- get a handle to it so I can do things like select the entire range? Or
- what do I do to associate the TE record with the right area on the
- screen? I CAN get a handle to the _text_ in the TE record, which is
- sometimes useful but is _not_ what I need here.
-
- Is there any way to get this handle? Failing that, is there any other
- way to accomplish the same sort of thing?
-
- BTW, I have played around with other ways of arranging the dialog, but
- I just can't find anything as clean or as Mac-like as the arrangement
- I've described above.
-
- aTdHvAaNnKcSe
-
- - -- Dave Matuszek (dave@prc.unisys.com) I don't speak for my employer. --
-
- +++++++++++++++++++++++++++
-
- From: Jeremiah.Blatz@dartmouth.edu (Jeremiah Blatz)
- Date: 26 Mar 92 04:12:20 GMT
- Organization: Dartmouth College, Hanover, NH
-
- Inside Mac Vol. 1 tells you how to do this stuff on pp. 421-422. The
- routines are (In pascal):
-
- PROCEDURE GetDItem(theDialog: DialogPtr; itemNo: INTEGER; VAR itemType:
- INTEGER; VAR item: Handle; VAR box: Rect);
-
- itemType will be an editText, item is a handle to the item you specify
- in "itemNo".
-
- After you do that, you can call:
-
- PROCEDURE GetIText (item: Handle; VAR text: Str255);
-
- "item" is the handle you got in GetDItem, text is the field's contents.
- (If they're more than 255 characters in the editText item, the Mac
- chops off the tail.)
-
- By the way, if you want to set a default value, you can use:
-
- PROCEDURE SetIText (item: Handle; text: Str255);
-
- By convention, you should hilite the default with:
-
- PROCEDURE SelIText (theDialog: DialogPtr; itemNo: INTEGER;
- strtSel,endSel: INTEGER);
-
- You should pass 0 for strtSel and 32767 for sndSel to hilite the whole
- thang.
-
- Hope this helps,
- JerBl@Dartmouth.edu
- In case Apple gets pissy about copyrights, all of this is from Inside
- Macintosh, but if you mess up, it's not their fault.
-
- +++++++++++++++++++++++++++
-
- From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
- Date: 1 Apr 92 04:30:20 GMT
- Organization: MacDTS, Apple Computer
-
- In article <1992Mar19.193848.10796@gvl.unisys.com>, dave@PRC.Unisys.COM (David Lee Matuszek) writes:
- > BUT if I click on a radio button, I want to be able to select the
- > correct TE, and select/highlight the range of text in it. I can't do
- > this.
- >
- > Is there any way to get this handle? Failing that, is there any other
- > way to accomplish the same sort of thing?
-
- Use the dialog manager call SelIText (Inside Macintosh I-422). It will allow
- you to select a particular item and to select the text in that item (pass
- 0 and 32000 for min and max respectively).
-
- Enjoy,
- Tim Dierks
- MacDTS, but I refuse to sing.
-
- ---------------------------
-
- From: elon@phsbbs.princeton.nj.us (Elon Danziger)
- Subject: Two Neophyte Questions (dialog box, screen depth)
- Date: Sat, 21 Mar 92 08:46:53 EST
- Organization: Princeton High School, Princeton, New Jersey
-
- Greetings. I'm having two problems programming under Pascal. First, I
- can't get the insertion point to blink or highlighting to work in a
- dialog box, and I don't know how to determine screen depth.
-
- Here's my code for the dialog box; I'm hoping someone can tell me what
- I've done wrong:
-
- repeat
- SystemTask;
- if (GetNextEvent(EveryEvent, eventRec)) then
- begin
- if IsDialogEvent(eventRec) then
- writeln(DialogSelect(eventRec, aDialog, item));
- end;
- case eventRec.what of
- KeyDown, AutoKey:
- begin
- theChar := Chr(BitAnd(eventRec.Message, charCodeMask));
- end;
-
- ActivateEvt:
- begin
- if BitAnd(eventRec.Modifiers, activeFlag) <> 0 then
- begin
- SetPort(WindowPtr(eventRec.Message));
- case GetWRefCon(WindowPtr(eventRec.Message)) of
- MainWindRef:
- ;
- end;
- end
- else
- case GetWRefCon(WindowPtr(eventRec.Message)) of
- MainWindRef:
- ;
- end;
- end;
- UpdateEvt:
- begin
- BeginUpdate(WindowPtr(eventRec.Message));
- case GetWRefCon(WindowPtr(eventRec.Message)) of
- MainWindRef:
- ;
- end;
- EndUpdate(WindowPtr(eventRec.Message));
- end;
-
- That WriteLn up there is really for debugging purposes, but it didn't
- help much.
-
- Anyway, if you don't have time to look at that code, I would appreciate
- some sample code using dialog boxes, controls, and so forth.
-
- Thanks in advance!
-
- - -Elon
-
- Elon Danziger, Technical SysOp PHSBBS Princeton High School
- DNS: elon@phsbbs.princeton.nj.us UUCP: ...!princeton!phsbbs!elon
- US Mail: 17 Chestnut Street / Princeton, NJ 08542
- DISCLAIMER: Author bears full responsibility for this message.
-
- +++++++++++++++++++++++++++
-
- From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
- Date: 1 Apr 92 04:38:24 GMT
- Organization: MacDTS, Apple Computer
-
- In article <u5NZHB2w164w@phsbbs.princeton.nj.us>, elon@phsbbs.princeton.nj.us (Elon Danziger) writes:
- >
- > Greetings. I'm having two problems programming under Pascal. First, I
- > can't get the insertion point to blink or highlighting to work in a
- > dialog box, and I don't know how to determine screen depth.
- >
- > Here's my code for the dialog box; I'm hoping someone can tell me what
- > I've done wrong:
- >
- > repeat
- > SystemTask;
- > if (GetNextEvent(EveryEvent, eventRec)) then
- > begin
- > if IsDialogEvent(eventRec) then
- > writeln(DialogSelect(eventRec, aDialog, item));
- > end;
-
- You need to call IsDialogEvent _regardless_ of whether GetNextEvent returns a
- null event or not; the cursor blinking occurs inside of this call, and if
- you don't call it on null events, no blinking will occur. Try this on
- for size:
-
- repeat
- gotEvent := GetNextEvent(EveryEvent, eventRec);
- SystemTask;
- if IsDialogEvent(eventRec) then
- writeln(DialogSelect(eventRec, aDialog, item));
- if gotEvent
- begin
- [... deal with the event]
- end;
-
- Forgive my faked-up Pascal. Note that you want to call SystemTask all the
- time also- if you ran your program as shown above under System 6 Finder and
- opened up the Alarm Clock, the time would only change when you posted an
- event.
-
- To determine the screen depth, you examine the depth of the pixMap associated
- with the gDevice for the screen you're interested in. This is described in
- Inside Mac volume V, chapters 4 and 5.
-
- Tim Dierks
- MacDTS, but my Sea-Monkeys die anyway
-
- ---------------------------
-
- From: mdavis@crash.cts.com (Morgan Davis)
- Subject: PostScript Tool Needed
- Organization: Crash TimeSharing, El Cajon, CA
- Date: Sat, 21 Mar 1992 18:37:38 GMT
-
- I've been in search of a utility that will easily allow me to send
- PostScript to a LaserWriter (via AppleTalk) and view any error messages
- coming back. All the apps I've scavenged don't seem to be able to
- run under System 7. For example, the myriad of SendPS programs all
- fail to open a connection with the printer, but Apple's LaserWriter
- Utility can do it just fine.
-
- The problem with Apple's utility is that it is too cumbersome for
- programming work. I'd like to be able to run an application that
- lets you write your PS code in one window, download it to the printer
- directly from the window, and then view any returned error messages
- (perhaps in a second window). This would allow for quick development
- and testing of PostScript programs under System 7.
-
- Any help or pointers to such a tool would be appreciated.
-
- +++++++++++++++++++++++++++
-
- From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
- Date: 23 Mar 92 18:38:20 +1200
- Organization: University of Waikato, Hamilton, New Zealand
-
- In article <1992Mar21.183738.23447@crash.cts.com>, mdavis@crash.cts.com
- (Morgan Davis) asks for a tool to send PostScript to a LaserWriter
- and retrieve any messages from the printer.
-
- I wrote one that runs as an MPW tool. This way I could use MPW itself
- to edit the PostScript and view the printer messages. If this is of any
- use to you, just ask, and I'll send you a copy.
-
- Lawrence D'Oliveiro fone: +64-7-856-2889
- Computer Services Dept fax: +64-7-838-4066
- University of Waikato electric mail: ldo@waikato.ac.nz
- Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
-
- +++++++++++++++++++++++++++
-
- From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
- Date: 1 Apr 92 04:40:27 GMT
- Organization: MacDTS, Apple Computer
-
- In article <1992Mar21.183738.23447@crash.cts.com>, mdavis@crash.cts.com (Morgan Davis) writes:
- >
- > I've been in search of a utility that will easily allow me to send
- > PostScript to a LaserWriter (via AppleTalk) and view any error messages
- > coming back. All the apps I've scavenged don't seem to be able to
- > run under System 7. For example, the myriad of SendPS programs all
- > fail to open a connection with the printer, but Apple's LaserWriter
- > Utility can do it just fine.
- >
- > Any help or pointers to such a tool would be appreciated.
-
- All System 6 SendPS programs will work correctly if you move the LaserWriter
- file to your System Folder from your Extensions folder (not an alias).
- They're looking for necessary code, and they can't find the file they
- need.
-
- Tim Dierks
- MacDTS, but why?
-
- ---------------------------
-
- From: gam@beta.lanl.gov (Gim Mark)
- Subject: animation: novice needs help
- Date: 25 Mar 92 15:49:24 GMT
- Organization: Los Alamos National Laboratory
-
-
- I'm trying to learn how to do animation on my Mac Plus with Think C
- 5.0. As a start, I want to simulate a billiard ball on a table.
- Here's the basic code I'm using:
-
- /* initialize position and velocities */
- FrameOval( ... );
- while ( /* conditions are OK */ )
- {
- pause();
- EraseOval( ... );
- OffsetRect( ... );
- FrameOval( ... );
- /* recalculate position and velocities */
- }
-
- 'pause()' exists simply to waste time; it increments an int 1000
- times. Without it, the loop goes so fast you can't see any movement.
-
- This code does produce an animation, but it flickers. I read in the
- answers to FAQ's for this group that, to prevent flicker, one should
- synchronize redrawing with the vertical refresh. That sounds
- reasonable but I have no idea how to do it.
-
- My questions: what's the best way to pace the animation loop?
- ('pause()' is a poor and wasteful kludge.) Are QuickDraw routines the
- best to use? (Might bitmaps be better? How are they used?) How does
- one deal with flicker? Most generally, are there books or other
- references that deal with this subject?
-
- Thanks.
-
- Graham Mark
- Los Alamos National Laboratory
- (505)667-8147
-
- +++++++++++++++++++++++++++
-
- From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
- Date: 25 Mar 92 20:50:12 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
- > gam@beta.lanl.gov (Gim Mark) writes:
-
- 'pause()' exists simply to waste time; it increments an int 1000
- times. Without it, the loop goes so fast you can't see any movement.
-
- That might be all well on a MacPlus, but on a Quadra, iterating
- 1000 times takes 50 microseconds or so; not a long enough pause...
-
- Use TickCount() instead.
-
- On the plus, it has the interesting side effect to be synchronized
- the vertical retrace !
-
- - --
- h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
-
- +++++++++++++++++++++++++++
-
- From: psc9q@holmes.acc.Virginia.EDU (Paul Casey)
- Date: 27 Mar 92 01:43:14 GMT
- Organization: University of Virginia
-
- In article <D88-JWA.92Mar25215012@hemul.nada.kth.se> d88-jwa@hemul.nada.kth.se (Jon W{tte) writes:
- : > gam@beta.lanl.gov (Gim Mark) writes:
- :
- : 'pause()' exists simply to waste time; it increments an int 1000
- : times. Without it, the loop goes so fast you can't see any movement.
- :
- : That might be all well on a MacPlus, but on a Quadra, iterating
- : 1000 times takes 50 microseconds or so; not a long enough pause...
- :
- : Use TickCount() instead.
- :
- : On the plus, it has the interesting side effect to be synchronized
- : the vertical retrace !
- :
- : --
- : h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
-
- Actually, I believe TickCount() was intended to be updated with the vertical
- retrace on older Macs and isn't a side effect. Now that one is able to have
- multiple monitors each with a potentially different refresh rate, TickCount()
- no longer holds. It is still updated every 60.15ms (I believe), so you could
- base your pause() routine on this.
-
- Paul Casey
- psc9q@virginia.edu
-
- +++++++++++++++++++++++++++
-
- From: Roy_Lovejoy@adeptsln.cts.com
- Date: 29 Mar 92 21:45:26 GMT
- Organization: Adept Solutions
-
- In article <1992Mar25.154924.19465@newshost.lanl.gov> gam@beta.lanl.gov (Gim
- Mark) writes:
- >
- > I'm trying to learn how to do animation on my Mac Plus with Think C
- > 5.0. As a start, I want to simulate a billiard ball on a table.
- > Here's the basic code I'm using:
- >
- > << CODE REMOVED>>
- > 'pause()' exists simply to waste time; it increments an int 1000
- > times. Without it, the loop goes so fast you can't see any movement.
- >
- >
- > Graham Mark
- > Los Alamos National Laboratory
- > (505)667-8147
-
- Graham, 'tis bit of a no-no to use loop-based timing.. The loop will execute
- magnatudes faster on a Quadra, than on a stock-plus! It's best to use Delay(),
- or more directly, TickCount(), which is based on 1/60 of a second time
- intervals.
-
- - -Roy
- - --
- - -----------------+--------------------------------------------------
- Roy Lovejoy | internet: roy@adeptsln.cts.com
- Head RGB Guy | AppleLink: adept
- Adept Solutions | CIS: 72447,1447
-
- +++++++++++++++++++++++++++
-
- From: mhall@occs.cs.oberlin.edu (Matthew Hall)
- Organization: Oberlin College Computer Science
- Date: Wed, 1 Apr 1992 17:55:44 GMT
-
- - -All right, but how to actually implement this-
-
- Tickcount isa function which retrieves a lo-mem global that stores the
- number of ticks since the system started up. It increments as soon as
- the bottom of the screen has finished drawing on small screen macs.
- When the bttom has finished drawing you have a few milliseconds to
- draw on the screen and not flicker. So - one way to do this, on a
- small screen mac only, goes like this:
-
- ...
- var tc : longint;
- ...
-
- {prepare to draw}
- tc:=tickcount;
- repeat
- until tc<tickcount;
- {draw FAST}
-
- If you need a delay of n 60ths of a second, you can replace
- until tc<tickcount
- with
- until tc+DELAY<tickcount.
-
- In Think environments, you are provided with a Synch procedure, which
- halts the program until the beam is at the TOP of the picture and then
- returns control. This should work on all macs (I think)
-
- Another note- Drawing ovals takes (relatively) a lot of time. It's
- probably best to just create an offscreen bitmap, draw a circle in
- there, and copybits, it will be much faster. See the monthly FAQ list
- if you need to learn more about bitmaps, I think there is something in
- there.
-
- - -Matt Hall
-
-
- - --
-
-
- - -------------------------------------------------------------------------------
- Matt Hall. mhall@occs.cs.edu OR SMH9666@OBERLIN.BITNET
- (216)-775-5805 (That's a Cleveland Area code. Lucky Me)
-
- "If a man comes up to you and says:
- 'A dog just carried away your ear.'
- Do you run after the dog, or search first for your ear?" - Moon over Morocco
-
-
- ---------------------------
-
- From: dave@coombs.anu.edu.au (David G. White)
- Subject: Anyone want to write/has written a 'sun-mouse' init ?;-}
- Organization: Computer Services Centre, Australian National University
- Date: 27 Mar 92 01:43:05 GMT
-
- You might have seen my post in c.m.s.system asking about the availabilty
- of a 'sun-mouse' init - ie an init that makes the window that is under the
- mouse the currently active window. Well it seems that not only has no-one
- seen one of these babies but quitte a few people want one too.
-
- So I don't supppose there is a community-minded programmer out there who
- wants to help us out ? ;-} please please please ? :-) with sugar ? :)
-
- Well it was worth a try ;)
-
- Thanks (in anticipation),
-
- David.
-
- - --
- _ David G. White ________________________ ______ _____ "What I did with _
- _ dave@coombs.anu.edu.au _________________ \ / ______ Rex Mossop wasnt _
- _ 2 Spencer Street, Turner, ______________ \ / _______ Porn,it was Art" _
- _ ACT 2601, Australia. Ph: +61 6 248 6836 __ \/ ________ - Julian Clarey _
-
- +++++++++++++++++++++++++++
-
- From: d88-jwa@byse.nada.kth.se (Jon W{tte)
- Date: 27 Mar 92 18:35:20 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
- @coombs.anu.edu.au (David G. White) writes:
-
- of a 'sun-mouse' init - ie an init that makes the window that is under the
- mouse the currently active window. Well it seems that not only has no-one
-
- You would have to get really, _really_, REALLY down and dirty to pull
- something like that off. And all for something which I don't even see
- the value of - I run MWM instead of TWM just because I loke a fixed focus.
-
- So I don't supppose there is a community-minded programmer out there who
- wants to help us out ? ;-} please please please ? :-) with sugar ? :)
-
- There is a shareware editor (called Alpha) that supported that mode
- of operation last I checked. However, that's only for the editor,
- it doesn't affect other applications.
-
- - --
- h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
-
- +++++++++++++++++++++++++++
-
- From: mkelly@majestix.cs.uoregon.edu (Michael A. Kelly)
- Organization: University of Oregon Computer and Information Sciences Dept.
- Date: Fri, 27 Mar 1992 23:21:00 GMT
-
- In article <D88-JWA.92Mar27193520@byse.nada.kth.se> d88-jwa@byse.nada.kth.se (Jon W{tte) writes:
- >@coombs.anu.edu.au (David G. White) writes:
- >
- > of a 'sun-mouse' init - ie an init that makes the window that is under the
- > mouse the currently active window. Well it seems that not only has no-one
- >
- >You would have to get really, _really_, REALLY down and dirty to pull
- >something like that off. And all for something which I don't even see
- >the value of - I run MWM instead of TWM just because I loke a fixed focus.
-
- I'm probably just being naive, but this seems like a relatively simple task.
- Just keep track of the mouse position (with GetMouse, probably) and post a
- mousedown in the title bar (or some other harmless region) of the window
- it's over when it moves from one window to another. That's probably not the
- best way to do it. You could probably also force the window's application to
- come to the front without posting a mousedown, especially with system 7.
-
- Am I missing something? I almost felt compelled to write the init when I saw
- the original post, but I'm just too busy....
-
- Mike.
- - --
- _____________________________________________________________________________
- Michael A. Kelly University of Oregon
- mkelly@cs.uoregon.edu Computer Science Department
- _____________________________________________________________________________
-
- +++++++++++++++++++++++++++
-
- From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher)
- Date: 27 Mar 92 17:46:15 GMT
- Organization: Integrated Systems Laboratory, ETH, Zurich
-
- In article <dave.701660585@coombs> dave@coombs.anu.edu.au (David G. White) writes:
- >You might have seen my post in c.m.s.system asking about the availabilty
- >of a 'sun-mouse' init - ie an init that makes the window that is under the
- >mouse the currently active window. Well it seems that not only has no-one
- >seen one of these babies but quitte a few people want one too.
- >
- >So I don't supppose there is a community-minded programmer out there who
- >wants to help us out ? ;-} please please please ? :-) with sugar ? :)
-
- I thought about doing such a thing. It might be possible to do by patching
- FrontWindow to return the window the cursor is in.
-
- I see three main problems:
-
- 1) Nobody wants it so badly that they want to risk the eternal wrath of the
- window manager
-
- 2) It's almost impossible to separate usages of FrontWindow where the front
- window should be returned and usages where the mouse window should.
-
- 3) What about modal dialogs ?
-
- Summary: Not for the weak of heart.
-
- Matthias
-
- - -----
- Matthias Neeracher neeri@iis.ethz.ch
- "You must have picked up that copy of Scarlett instead of Inside Mac
- when you tried to find the right call..." -- Keith Rollin
-
- +++++++++++++++++++++++++++
-
- From: gurhs@uniwa.uwa.oz.au (Rhys Hollow)
- Organization: University of Western Australia
- Date: Sun, 29 Mar 1992 08:08:43 GMT
-
- neeri@iis.ethz.ch (Matthias Ulrich Neeracher) writes:
-
- >In article <dave.701660585@coombs> dave@coombs.anu.edu.au (David G. White) writes:
- >>You might have seen my post in c.m.s.system asking about the availabilty
- >>of a 'sun-mouse' init - ie an init that makes the window that is under the
- >>mouse the currently active window. Well it seems that not only has no-one
- >>seen one of these babies but quitte a few people want one too.
- >>
- >>So I don't supppose there is a community-minded programmer out there who
- >>wants to help us out ? ;-} please please please ? :-) with sugar ? :)
-
- >I thought about doing such a thing. It might be possible to do by patching
- >FrontWindow to return the window the cursor is in.
-
-
- WHY? Why do such a horrible thing? Have you thought of the
- consequences? What happens when you want to select a menu? You move
- the mouse to the menu bar and... oops, the mouse moved over a different
- window, bringing a different window to the front, even a different
- application, thus either changing the menus completely, or losing the
- window you wanted to do the menu command on. I HATE SUN MOUSES!
-
- Someone put them on the amiga, thinking it was a great idea. The Amiga
- would have had the same problem as the mac, but it had a separate mouse
- button you had to press to bring up the menubar. So as long as you
- pressed the menu button while you were over the appropriate window,
- everything was ok, but if you didn't, the same thing happened. The sun
- mouse brought a different window/application to the front, and you had
- to start all over again.
-
- I think what I'm saying is that while sun mice are allright on suns
- because they have pop-up menus, they would be a disaster on a mac.
- (At least this is what I assume they have on a sun, I haven't used a
- sun, so I'm not entirely sure)
-
- Rhys (raving again...)
- - --
- Rhys Hollow (gurhs@uniwa.uwa.oz.au) "ee'er by gum he's a bad'un!" -DangerMouse.
-
- +++++++++++++++++++++++++++
-
- From: d88-jwa@byse.nada.kth.se (Jon W{tte)
- Date: 27 Mar 92 18:35:20 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
- @coombs.anu.edu.au (David G. White) writes:
-
- of a 'sun-mouse' init - ie an init that makes the window that is under the
- mouse the currently active window. Well it seems that not only has no-one
-
- You would have to get really, _really_, REALLY down and dirty to pull
- something like that off. And all for something which I don't even see
- the value of - I run MWM instead of TWM just because I loke a fixed focus.
-
- So I don't supppose there is a community-minded programmer out there who
- wants to help us out ? ;-} please please please ? :-) with sugar ? :)
-
- There is a shareware editor (called Alpha) that supported that mode
- of operation last I checked. However, that's only for the editor,
- it doesn't affect other applications.
-
- - --
- h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
-
- +++++++++++++++++++++++++++
-
- From: mkelly@majestix.cs.uoregon.edu (Michael A. Kelly)
- Organization: University of Oregon Computer and Information Sciences Dept.
- Date: Fri, 27 Mar 1992 23:21:00 GMT
-
- In article <D88-JWA.92Mar27193520@byse.nada.kth.se> d88-jwa@byse.nada.kth.se (Jon W{tte) writes:
- >@coombs.anu.edu.au (David G. White) writes:
- >
- > of a 'sun-mouse' init - ie an init that makes the window that is under the
- > mouse the currently active window. Well it seems that not only has no-one
- >
- >You would have to get really, _really_, REALLY down and dirty to pull
- >something like that off. And all for something which I don't even see
- >the value of - I run MWM instead of TWM just because I loke a fixed focus.
-
- I'm probably just being naive, but this seems like a relatively simple task.
- Just keep track of the mouse position (with GetMouse, probably) and post a
- mousedown in the title bar (or some other harmless region) of the window
- it's over when it moves from one window to another. That's probably not the
- best way to do it. You could probably also force the window's application to
- come to the front without posting a mousedown, especially with system 7.
-
- Am I missing something? I almost felt compelled to write the init when I saw
- the original post, but I'm just too busy....
-
- Mike.
- - --
- _____________________________________________________________________________
- Michael A. Kelly University of Oregon
- mkelly@cs.uoregon.edu Computer Science Department
- _____________________________________________________________________________
-
- +++++++++++++++++++++++++++
-
- From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher)
- Date: 27 Mar 92 17:46:15 GMT
- Organization: Integrated Systems Laboratory, ETH, Zurich
-
- In article <dave.701660585@coombs> dave@coombs.anu.edu.au (David G. White) writes:
- >You might have seen my post in c.m.s.system asking about the availabilty
- >of a 'sun-mouse' init - ie an init that makes the window that is under the
- >mouse the currently active window. Well it seems that not only has no-one
- >seen one of these babies but quitte a few people want one too.
- >
- >So I don't supppose there is a community-minded programmer out there who
- >wants to help us out ? ;-} please please please ? :-) with sugar ? :)
-
- I thought about doing such a thing. It might be possible to do by patching
- FrontWindow to return the window the cursor is in.
-
- I see three main problems:
-
- 1) Nobody wants it so badly that they want to risk the eternal wrath of the
- window manager
-
- 2) It's almost impossible to separate usages of FrontWindow where the front
- window should be returned and usages where the mouse window should.
-
- 3) What about modal dialogs ?
-
- Summary: Not for the weak of heart.
-
- Matthias
-
- - -----
- Matthias Neeracher neeri@iis.ethz.ch
- "You must have picked up that copy of Scarlett instead of Inside Mac
- when you tried to find the right call..." -- Keith Rollin
-
- +++++++++++++++++++++++++++
-
- From: gurhs@uniwa.uwa.oz.au (Rhys Hollow)
- Organization: University of Western Australia
- Date: Sun, 29 Mar 1992 08:08:43 GMT
-
- neeri@iis.ethz.ch (Matthias Ulrich Neeracher) writes:
-
- >In article <dave.701660585@coombs> dave@coombs.anu.edu.au (David G. White) writes:
- >>You might have seen my post in c.m.s.system asking about the availabilty
- >>of a 'sun-mouse' init - ie an init that makes the window that is under the
- >>mouse the currently active window. Well it seems that not only has no-one
- >>seen one of these babies but quitte a few people want one too.
- >>
- >>So I don't supppose there is a community-minded programmer out there who
- >>wants to help us out ? ;-} please please please ? :-) with sugar ? :)
-
- >I thought about doing such a thing. It might be possible to do by patching
- >FrontWindow to return the window the cursor is in.
-
-
- WHY? Why do such a horrible thing? Have you thought of the
- consequences? What happens when you want to select a menu? You move
- the mouse to the menu bar and... oops, the mouse moved over a different
- window, bringing a different window to the front, even a different
- application, thus either changing the menus completely, or losing the
- window you wanted to do the menu command on. I HATE SUN MOUSES!
-
- Someone put them on the amiga, thinking it was a great idea. The Amiga
- would have had the same problem as the mac, but it had a separate mouse
- button you had to press to bring up the menubar. So as long as you
- pressed the menu button while you were over the appropriate window,
- everything was ok, but if you didn't, the same thing happened. The sun
- mouse brought a different window/application to the front, and you had
- to start all over again.
-
- I think what I'm saying is that while sun mice are allright on suns
- because they have pop-up menus, they would be a disaster on a mac.
- (At least this is what I assume they have on a sun, I haven't used a
- sun, so I'm not entirely sure)
-
- Rhys (raving again...)
- - --
- Rhys Hollow (gurhs@uniwa.uwa.oz.au) "ee'er by gum he's a bad'un!" -DangerMouse.
-
- +++++++++++++++++++++++++++
-
- From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher)
- Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
- Date: Sun, 29 Mar 1992 18:25:50 GMT
-
- mkelly@majestix.cs.uoregon.edu (Michael A. Kelly) writes:
-
- >In article <D88-JWA.92Mar27193520@byse.nada.kth.se> d88-jwa@byse.nada.kth.se (Jon W{tte) writes:
- >>@coombs.anu.edu.au (David G. White) writes:
- >>
- >> of a 'sun-mouse' init - ie an init that makes the window that is under the
- >> mouse the currently active window. Well it seems that not only has no-one
- >>
- >>You would have to get really, _really_, REALLY down and dirty to pull
- >>something like that off. And all for something which I don't even see
- >>the value of - I run MWM instead of TWM just because I loke a fixed focus.
- >
- >I'm probably just being naive, but this seems like a relatively simple task.
- >Just keep track of the mouse position (with GetMouse, probably) and post a
- >mousedown in the title bar (or some other harmless region) of the window
- >it's over when it moves from one window to another.
-
- No, that's not what the original poster wants. You probably never use Unix
- window systems: They distingish between *front* window and *active* window.
- So, you'd have to write an INIT that makes an application interpret keystrokes
- for the window the mouse points to (which is *not* necessarily the front
- window).
-
- Matthias
-
- - -----
- Matthias Neeracher neeri@iis.ethz.ch
- "And that's why I am going to turn this world upside down, and make
- of it a fire so *bright* that someone real will notice"
- -- Vernor Vinge, _Tatja Grimm's World_
-
- +++++++++++++++++++++++++++
-
- From: ari@eclectic.com (Ari Halberstadt)
- Date: 30 Mar 92 19:29:01 GMT
- Organization: Eclectic Associates, Inc.
-
- In article <1992Mar29.080843.14883@uniwa.uwa.oz.au> gurhs@uniwa.uwa.oz.au (Rhys Hollow) writes:
- >neeri@iis.ethz.ch (Matthias Ulrich Neeracher) writes:
- >>In article <dave.701660585@coombs> dave@coombs.anu.edu.au (David G. White) writes:
- >>>an init that makes the window that is under the
- >>>mouse the currently active window.
- >>I thought about doing such a thing. It might be possible to do by patching
- >>FrontWindow to return the window the cursor is in.
- >What happens when you want to select a menu? You move
- >the mouse to the menu bar and... oops, the mouse moved over a different
- >window, bringing a different window to the front, even a different
- >application, thus either changing the menus completely, or losing the
- >window you wanted to do the menu command on.
- >...
- >I think what I'm saying is that while sun mice are allright on suns
- >because they have pop-up menus, they would be a disaster on a mac.
- >(At least this is what I assume they have on a sun, I haven't used a
- >sun, so I'm not entirely sure)
-
- You could make a monster extension which supports popup menus as well. But
- with a one buttoned mouse I think the conclusion is correct that it wouldn't
- be very user friendly. Even convincing the Window Manager to support
- floating windows from within an application requires bypassing much of
- the Window Manager, and the default WDEF makes it even harder since it insists
- on unhiliting the drag bar when the window isn't front most. Doing this
- from a system extension, and being compatible with all apps, sounds rather
- difficult.
- - --
- Ari Halberstadt ari@eclectic.com #include <std/disclaimer.h>
- Ramsgate (n.) All institutional buildings must, by law, contain at least twenty
- ramsgates. These are doors that open the opposite way to the one you expect.
- -- D. Adams & J. Lloyd "The Meaning of Liff", p75.
-
- +++++++++++++++++++++++++++
-
- From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher)
- Organization: Integrated Systems Laboratory, ETH, Zurich
- Date: Wed, 1 Apr 1992 17:53:44 GMT
-
- In article <1992Mar29.080843.14883@uniwa.uwa.oz.au> gurhs@uniwa.uwa.oz.au (Rhys Hollow) writes:
- >neeri@iis.ethz.ch (Matthias Ulrich Neeracher) writes:
- >
- >>In article <dave.701660585@coombs> dave@coombs.anu.edu.au (David G. White) writes:
- >>>You might have seen my post in c.m.s.system asking about the availabilty
- >>>of a 'sun-mouse' init - ie an init that makes the window that is under the
- >>>mouse the currently active window. Well it seems that not only has no-one
- >>>seen one of these babies but quitte a few people want one too.
- >>>
- >>>So I don't supppose there is a community-minded programmer out there who
- >>>wants to help us out ? ;-} please please please ? :-) with sugar ? :)
- >
- >>I thought about doing such a thing. It might be possible to do by patching
- >>FrontWindow to return the window the cursor is in.
- >
- >WHY? Why do such a horrible thing? Have you thought of the
- >consequences?
-
- Yes.
-
- >What happens when you want to select a menu? You move
- >the mouse to the menu bar and... oops, the mouse moved over a different
- >window, bringing a different window to the front, even a different
- >application, thus either changing the menus completely, or losing the
- >window you wanted to do the menu command on.
-
- No. By moving the mouse, *no window would be brought to the front*. All that
- would happen is that FrontWindow would *pretend* a different window was in
- front. And it would do this only in response to a keyDown event. I agree that
- this is in practice impossible to implement on the *OS* side, but applications
- could do this.
-
- >I HATE SUN MOUSES!
-
- The only application on my Mac that I would want to behave in an Unix way is
- MacLayers.
-
- >I think what I'm saying is that while sun mice are allright on suns
- >because they have pop-up menus, they would be a disaster on a mac.
- >(At least this is what I assume they have on a sun, I haven't used a
- >sun, so I'm not entirely sure)
-
- The normal ones have popup menus. OpenWindows Suns have button stacks, which is
- a visually quite unpleasant implementation of popup menus.
-
- Matthias
-
- - -----
- Matthias Neeracher neeri@iis.ethz.ch
- "And that's why I am going to turn this world upside down, and make
- of it a fire so *bright* that someone real will notice"
- -- Vernor Vinge, _Tatja Grimm's World_
-
- ---------------------------
-
- From: thomasl@cat52.cs.wisc.edu (Thomas Lawrence)
- Subject: filename from pathnumber
- Date: 29 Mar 92 23:03:08 GMT
- Organization: University of Wisconsin, Madison -- Computer Sciences Dept.
-
- I've checked Inside Macintosh IV and V about this
- but I can't find a solution. I need my program to
- open its data fork, even if the user has renamed
- the program. To do this, I figured I could obtain
- the (preopened) resource fork path reference
- number, recover the file name and directory
- number, and FSOpen the data fork. Unfortunately
- I can find no way of recovering the name of a
- file from only a path number. FSGetFInfo requires
- a filename and directory number and PBGetFInfo
- seems to require the same.
-
- +++++++++++++++++++++++++++
-
- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
- Organization: Kalamazoo College
- Date: Mon, 30 Mar 1992 05:30:01 GMT
-
- thomasl@cat52.cs.wisc.edu (Thomas Lawrence) writes:
- >I need my program to
- >open its data fork, even if the user has renamed
- >the program. To do this, I figured I could obtain
- >the (preopened) resource fork path reference
- >number, recover the file name and directory
- >number, and FSOpen the data fork. Unfortunately
- >I can find no way of recovering the name of a
- >file from only a path number.
-
- Immediately after your application launches, you can get its directory
- with GetVol (IM4-107). It returns you a vRefNum that's actually a
- directory ID. It seems like there should be a better way to do this,
- but it's worked for me.
-
- Your app's name is available from GetAppParms (IM2-58). Again, do this
- before your first event loop so the user doesn't have a chance to move
- or rename you.
-
- You didn't say if you were planning on modifying the data fork, so I'll
- put the standard don't-write-to-your-application spiel in just to be
- sure: what if you're on CD-ROM? what if you're on a server and the user
- doesn't have write privs? what if your user does a backup-changed-files
- every day and thereby ends up storing 365 copies of your app per year?
- - --
- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy
- PC Adventure: "You killed a small height-disadvantaged person.
- The body vanishes in a cloud of greasy black smoke."
-
- +++++++++++++++++++++++++++
-
- From: glenn@gla-aux.uucp (Glenn Austin)
- Date: Wed, 1 Apr 92 14:36:51 PST
- Organization: The Pit Lane
-
-
- In article <1992Mar29.230308.13722@daffy.cs.wisc.edu> (comp.sys.mac.programmer), thomasl@cat52.cs.wisc.edu (Thomas Lawrence) writes:
- > I've checked Inside Macintosh IV and V about this
- > but I can't find a solution. I need my program to
- > open its data fork, even if the user has renamed
- > the program. To do this, I figured I could obtain
- > the (preopened) resource fork path reference
- > number, recover the file name and directory
- > number, and FSOpen the data fork. Unfortunately
- > I can find no way of recovering the name of a
- > file from only a path number. FSGetFInfo requires
- > a filename and directory number and PBGetFInfo
- > seems to require the same.
-
- PBGetFCBInfo is the answer. Not only can you get the filename, but you
- can also get almost all the other particulars about the file...
-
- ===============================================================================
- | Glenn L. Austin | "Turn too soon, run out of room. |
- | Macintosh Wizard and | Turn too late, much better fate." |
- | Auto Racing Driver | -- Jim Russell Racing School Instructors |
- | Usenet: glenn@gla-aux.uucp or glenn%gla-aux.uucp@skinner.cs.uoregon.edu |
- ===============================================================================
-
- ---------------------------
-
- From: swb1_ltd@uhura.cc.rochester.edu (Steve Berkley)
- Subject: Floppy Disk Override Part II
- Organization: University of Rochester - Rochester, New York
- Date: Mon, 30 Mar 92 16:07:33 GMT
-
- The solution to the floppy problem seemed to be prompting the
- user to insert the disk, and using GetOSEvent, which removes
- the disk insertion event from the queue before the Finder can
- get to it...
-
- The next problem is this: I want to read 10 sectors for track
- on a GCD disk, consistently from track to track. I know there
- must be some way to do this, because there are programs like
- Copy II Mac which do this, etc. The disks I am making images of
- have 10 sectors per track...right now, the program is basically
- an imaging program for MAC disks, because the .Sony driver is
- thinking I am doing GCR disks (whoops- I mean GCR above). Is
- there someone out there, from Apple perhaps, who can tell me
- how to do this from Think C 5.0.2?? I know there are is a
- SonyEqu.a file that could be tampered with in MacApp, but I
- really don't want to dig around in assembly. A straightforward
- approach would be very helpful!!
-
- Thanks in advance-
- Steve Berkley
- swb1_ltd@uhura.cc.rochester.edu
-
-
- +++++++++++++++++++++++++++
-
- From: stevec@Apple.COM (Steve Christensen)
- Date: 1 Apr 92 03:50:52 GMT
- Organization: Apple Computer Inc., Cupertino, CA
-
- swb1_ltd@uhura.cc.rochester.edu (Steve Berkley) writes:
-
- >The next problem is this: I want to read 10 sectors for track
- >on a GCR disk, consistently from track to track...
- >Is there someone out there, from Apple perhaps, who can tell me
- >how to do this from Think C 5.0.2?? I know there are is a
- >SonyEqu.a file that could be tampered with in MacApp, but I
- >really don't want to dig around in assembly. A straightforward
- >approach would be very helpful!!
-
- This is not a great idea because you have to talk directly to the
- Mac's hardware to make it work. Since the low-level floppy disk
- software implementations vary depending on the kind of Mac you're
- using, you need to know all the details for the kind(s) of Mac
- you intend to support. In any case, tweaking the .Sony driver's
- variables won't get you too far, since it's designed to deal with
- only a few specific disk formats (400K GCR, 800K GCR, 720K MFM,
- and 1.44M MFM).
-
- That said, are you sure the disks you want to read/write are indeed
- encoded in GCR? The Mac gets from 8-12 sectors per track because
- that's what fits on each track. You could get more sectors if the
- sector format was different (smaller). It sounds more like the
- disk is recorded in MFM since those disks tend to have a fixed
- number of sectors per track...
-
- steve
- - --
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Steve Christensen Never hit a man with glasses.
- stevec@apple.com Hit him with a baseball bat.
-
- ---------------------------
-
- End of C.S.M.P. Digest
- **********************
-